#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 10;

int n, a[N];

multiset<int> s;

int main() {
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);

    ios::sync_with_stdio(false);
    cin >> n;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        s.insert(a[i]);
    }
    sort(a, a + n);
    for(int i = 0; i < n; i++) {
        s.erase(a[i]);
        while(s.size() && *s.begin() <= a[i])
            s.erase(s.begin());
        if(s.empty()) {
            cout << n - i << "\n";
            return 0;
        }
        s.erase(s.begin());
    }
    return 0;
}